<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.*" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%

	request.setCharacterEncoding("UTF-8");
	response.setCharacterEncoding("UTF-8");
    String name=request.getParameter("user_name");
    String messages=request.getParameter("messages");

    if(name=="")
    {
    	name="无信息";
    }
    if(messages=="")
    {
    	messages="无信息";
    }

    String time=new Date().toString();
    String s="#"+name+"#"+time+"#"+messages+"#";
    sendMessage(s);
    out.print("您的信息已经提交！");
   %>
   
   <%! 
   Vector v=new Vector();
   ServletContext application;
    synchronized void sendMessage(String s)
   {
	   application=getServletContext();
	   v.add(s);
	   application.setAttribute("Mess",v);
   }
   
   %>
   
<jsp:forward page="showMessage.jsp"></jsp:forward>
</body>
</html>
